from django.db import models
from luffyapi.utils.models import BaseModel  # 导入抽象基类


class Banner(BaseModel):
    name = models.CharField(max_length=32, verbose_name="图片名字")
    img = models.ImageField(upload_to="banner", verbose_name="轮播图", help_text="图片尺寸必须是：3840*800", null=True)  # 可以为空
    link = models.CharField(max_length=32, verbose_name="跳转链接")
    info = models.TextField(verbose_name="图片简介")

    def __str__(self):
        return self.name
